package com.ehotting.edsta.circuitDesign.enums;

public enum StateTypeEnum implements BaseEnum {

    NO(0,"否"),
    YES(1,"是");


    private Integer value;
    private String name;


    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    StateTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }


    public static StateTypeEnum getObject(Integer value){
        StateTypeEnum[] rules = StateTypeEnum.values();
        for(StateTypeEnum rule : rules){
            if(rule.getValue().equals(value)){
                return rule;
            }
        }
        return StateTypeEnum.NO;
    }

    public static StateTypeEnum getStateTypeEnumByName(String name) {
        StateTypeEnum[] values = StateTypeEnum.values();
        for (StateTypeEnum value : values) {
            if (value.getName().equals(name)) {
                return value;
            }
        }
        return null;
    }

}
